import pkgutil

MACROS = {}

iter = pkgutil.iter_modules(__path__)
for imp, name, ispkg in iter:
    if name in ['__init__', 'basemacro']:
        continue
    mod = __import__('.'.join([__name__, name]), fromlist='dummy')
    macro = mod.__dict__.get('MACRO')
    if macro is not None:
        MACROS[macro.__name__] = macro

